package com.study.mike.spring.sample.aop;

import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;

public class MyAroundAdvice implements MethodInterceptor {

	@Override
	public Object invoke(MethodInvocation invocation) throws Throwable {
		System.out.println(">> 环绕 - 前增强");
		Object ret = null;
		try {
			ret = invocation.proceed();
		} catch (Exception e) {
			System.err.println(e); //这一句会在后增强后执行--为啥??
		}
		System.out.println(">> 环绕 - 后增强");
		return ret;
	}

}
